package com.theanh.RssActivity.ui.model;

import com.theanh.RssActivity.R;

import android.app.Activity;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;

public class FinderModel {
	private static final String TAG = "FinderModel";
	public EditText name;
	public ImageButton close;
	public ImageButton find;
	LinearLayout mainView;
	Activity parent;
	
	public static FinderModel createModel(Activity parent) {
		FinderModel model = new FinderModel();
		model.parent = parent;
		model.name = (EditText) parent.findViewById(R.id.findItemNameEditText);
		model.name.setFocusable(true);
		model.close = (ImageButton) parent.findViewById(R.id.findCloseImageButton);
		model.find = (ImageButton) parent.findViewById(R.id.findItemImageButton);
		model.mainView = (LinearLayout) parent.findViewById(R.id.findItemLinearLayout);
		
//		model.close.setOnClickListener(model.closeOnClick);
//		model.find.setOnClickListener(model.findOnClick);
		
		return model;
	}
	
//	private OnClickListener closeOnClick = new OnClickListener() {
//		public void onClick(View view) {
//			FinderModel.this.mainView.setVisibility(View.GONE);
//		}
//	};
	
//	private OnClickListener findOnClick = new OnClickListener() {
//		public void onClick(View view) {
//			// TODO: Call find method
//			Log.i("TAG", "findOnClick");
//		}
//	};
	
	public void show(){
		this.mainView.setVisibility(View.VISIBLE);
	}
	
	public void hide(){
		this.mainView.setVisibility(View.GONE);
	}
}
